const forumRouter = {
  path: '/forum',
  component: () => import('@/layout'),
  redirect: '/forum/posts',
  name: 'Forum',
  meta: {
    title: '论坛管理',
    icon: 'message'
  },
  children: [
    {
      path: 'posts',
      component: () => import('@/views/forum/post-list'),
      name: 'PostList',
      meta: {
        title: '帖子管理',
        icon: 'documentation'
      }
    },
    {
      path: 'comments/:postId',
      component: () => import('@/views/forum/comment-list'),
      name: 'CommentList',
      meta: {
        title: '评论管理',
        noCache: true,
        activeMenu: '/forum/posts'
      },
      hidden: true
    },
    {
      path: 'users',
      component: () => import('@/views/forum/user-list'),
      name: 'UserList',
      meta: {
        title: '用户管理',
        icon: 'peoples',
        roles: ['admin']
      }
    },
    {
      path: 'categories',
      component: () => import('@/views/forum/category-list'),
      name: 'CategoryList',
      meta: {
        title: '分类管理',
        icon: 'tree',
        roles: ['admin']
      }
    },
    {
      path: 'user-posts/:userId',
      component: () => import('@/views/forum/user-posts'),
      name: 'UserPosts',
      meta: {
        title: '用户帖子',
        noCache: true,
        activeMenu: '/forum/users'
      },
      hidden: true
    }
  ]
}

export default forumRouter
